1. Field of the Invention
This invention relates to a ruled line extracting program, a ruled line extracting apparatus and a ruled line extracting method that extract a ruled line out of an image of a document.
2. Description of the Related Art
Known techniques that extract a broken ruled line from an image of a document that typically shows a slip include those adapted to select candidates of broken line elements (broken line element candidates) from link components of black pixels on the basis of the sizes and the profiles such as aspect ratios thereof and consolidate the broken line candidate elements according to the distances separating the broken line element candidates and the drifts (the vertical drifts in the case of a horizontal ruled line) of the broken line element candidates (see, for example, Patent Document 1: Jpn. Pat. Appln. Laid-Open Publication No. 9-319824). Fixed values are used by such techniques as threshold values for size and profile when selecting broken line element candidates and also as threshold values for distance and drift when consolidating broken line element candidates. Known techniques that estimate a threshold value include those adapted to estimate a threshold value by means of a histogram prepared from the entire image of a document (see, for example, Patent Document 2: Jpn. Pat. Appln. Laid-Open Publication No. 10-49676).
However, the threshold values of sub-processes of known broken ruled line extracting processes are fixed values as pointed out above and known broken ruled line extracting processes are designed to serially connect sub-processes. In other words, only broken ruled lines that satisfy the requirements of threshold values are extracted and a broken ruled line is not extracted if it does not satisfy only one of the requirements of threshold values. Conversely, noises that satisfy the requirements will erroneously be extracted as broken ruled line.
A technique of hypothetically generating every possible broken ruled line candidate by loosely defining threshold values and verifying if the candidate meets the requirements of being a broken ruled line or not so that only a right broken ruled line may be extracted is conceivable. However, if hypothetically generated candidates are simply sieved, a part of a broken ruled line that is over-consolidated with noises and a broken ruled line that is over-consolidated with another broken ruled line can be eliminated as being not a broken ruled line. Particularly, it is a serious problem for broken ruled lines extracted from color images that broken lines are over-consolidated with noises. Therefore, it is difficult for a process of extracting a broken ruled line that is formed by serially connecting sub-processes using fixed values as threshold values to highly accurately extract a broken ruled line.